package j2024.j202410;
class treeNode {
    int val;
    treeNode left;
    treeNode right;
    treeNode() {}
    treeNode(int val) { this.val = val; }
    treeNode(int val, treeNode left, treeNode right) {
        this.val = val;
        this.left = left;
        this.right = right;
    }
}
public class j1020 {
    public treeNode invertTree(treeNode root) {
        if(root == null){
            return null;
        }
        treeNode tmp = root.left;
        root.left = root.right;
        root.right = tmp;
        invertTree(root.left);
        invertTree(root.right);
        return root;
    }
}
